package com.recharge.core.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.recharge.core.entity.GoodsGroupEntity;
import com.recharge.core.entity.RouteFilterEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Reagan
 * @since 2020-09-21
 */
@Mapper
public interface RouteFilterMapper extends BaseMapper<RouteFilterEntity> {

    List<Map<String, Object>> findRouterByMerchantId(@Param("merchantId") String merchantId, @Param("routerType") Integer routerType);

    List<Map<String, Object>> findRouterByProviderId(@Param("providerId") String providerId, @Param("routerType") Integer routerType);

    Long selectProviderAndMerchantCount(@Param("providerId") String providerId, @Param("merchantId") String merchantId, @Param("routerType") Integer routerType);
    /**
     * 自定义分页查询
     * @param page
     * @param wrapper
     * @return
     */
    IPage<RouteFilterEntity> selectOtherPage(Page<RouteFilterEntity> page,@Param("ew") QueryWrapper<RouteFilterEntity> wrapper);
}
